using UnityEngine;
using System.Collections;
using System.Collections.Generic;

[AddComponentMenu("GK/GodVsAliens/Player/gkGodVsAliensPlayerRayController")]
[RequireComponent(typeof(gkSphericalOctoMeshPusher))]
[RequireComponent(typeof(gkInputScreenZoneTouch))]
/// \class  gkGodVsAliensPlayerRayController
/// \brief 	Player ray controller
public class gkGodVsAliensPlayerRayController : MonoBehaviour
{
	/// The push direction
	private gkSphericalOctoMeshPusher m_rSphericalOctoMeshPusher;
	
	/// The Zone Input component
	private gkInputScreenZoneTouch m_rInputScreenZoneTouch;
	
	/// \brief  Called just before the first update
	void Start () 
	{
		// Grab the spherical pusher
		m_rSphericalOctoMeshPusher = GetComponent<gkSphericalOctoMeshPusher>();
		
		// Get the input
		m_rInputScreenZoneTouch = GetComponent<gkInputScreenZoneTouch>();
	}
	
	/// \brief  Called each frame
	void Update () 
	{
		// if the ray is beeing used
		if(m_rInputScreenZoneTouch.IsZoneTouched())
		{
			m_rSphericalOctoMeshPusher.ProcessPush();
		}
	}
}